<!---
	Title:		EPAR1.1 
	Author:		Bruce Frick
	Purpose:	Step2 Conformation 2 page
--->

<cfset BASE = CreateObject("component", "cfc.base") / >
<Cfset baseQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfset step2Queries = CreateObject("component", "#session.rootDir#.cfc.step2Queries") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">

<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlHeader(
	"/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js,js/Step2-PreOrientation2.js", <!---JS links--->
    "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
    "Step 2:  HR - Pre Orientation 2", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->
    
        
    <cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)>
        
        <h1 class="title">Step 2:  HR - Pre Orientation</h1>
        <div class="entry">
        
            <cfset Processed = False>    
            
            <!--- if the employee to hire isn't specified, redirect to Step 2 - Page 1 --->
            <cfif not isdefined("URL.StepID")>
                <cflocation url="Step2-PreOrientation1.cfm" addtoken="no">
            </cfif>
            
			<!---Query objects--->
            <cfset QUERIES = {
				GetEmpInfo = baseQueries.funcGetEmpInfo(URL.StepID),
				GetShifts = baseQueries.funcGetShifts(),
				GetReasonCodes = baseQueries.funcGetReasonCodes('PP'),
				GetSalaryHourly = baseQueries.funcGetSalaryHourly('SH'),
				GetWorkersCompInfo = baseQueries.funcGetWorkersCompInfo(),
				GetReasonCodes = baseQueries.funcGetReasonCodes('PS'),
				GetCompTypes = baseQueries.funcGetCompTypes('CT'),
				GetFrequency = baseQueries.funcGetFrequency(),
				GetDepts = baseQueries.funcGetDepts(),
				GetPositions = baseQueries.funcGetPositions(),
				GetEmpCodes = baseQueries.funcGetEmpCodes()
            } />
            <!---Query objects--->
            
            <cfif QUERIES.GetEmpInfo.recordcount GT 0>    

                <cfif QUERIES.GetEmpInfo.PreferredName NEQ "">
                    <cfset Name = QUERIES.GetEmpInfo.First & ' (' & QUERIES.GetEmpInfo.PreferredName & ')'>
                <cfelse>
                    <cfset Name = QUERIES.GetEmpInfo.First>
                </cfif>
                <cfif QUERIES.GetEmpInfo.Middle NEQ "">
                    <cfset Name = Name & ' ' & QUERIES.GetEmpInfo.Middle>
                </cfif> 
                               
                <cfset Name = Name & ' ' & QUERIES.GetEmpInfo.Last>               
                
                <cfset QUERIES.GetNotes = step2Queries.funcGetNotes(QUERIES.GetEmpInfo.ID, 1) />
                
            <cfelse>
            
                <cfset Processed = True>
                
            </cfif>
            <!---Scott's old code--->
            
            <cfif not Processed>   
            
                <cfset QUERIES.GetSupDept = baseQueries.funcGetSupDept(QUERIES.GetEmpInfo.SupervisorID) />		
                <cfset QUERIES.GetJobPosting = baseQueries.funcGetJobPostings(QUERIES.GetEmpInfo.PostingID) />	
                
                <cfif QUERIES.GetEmpInfo.PostingID EQ -1>
                    <cfset JobToHire = "Other - See Manager Comments">
                <cfelse>		
                    <cfset JobToHire = "#QUERIES.GetJobPosting.JobTitle# (#QUERIES.GetJobPosting.Bulletin#)">
                </cfif>
     
                
                    Welcome, #Session.arrEmpInfo.FirstName# #Session.arrEmpInfo.LastName#.  
                    On this page you'll be asked to review the information provided by the hiring manager, 
                    and provide additional information you obtained during the negotion process.  
                    
                    <cfform name="frmStep2" method="post">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <fieldset>
                                        <legend>1) Information provided by the Hiring Manager:</legend>
                                        <table>
                                            <tr>
                                                <td width = "10">&nbsp;</td>
                                                <td>
                                                    Employee to Hire:
                                                </td>
                                                <td>
                                                    <cfinput type="text" name="First"
                                                        error_message="Please provide a first name for the employee you'd like to hire." 
                                                        tabindex="5" value="#QUERIES.GetEmpInfo.First#">
                                                    <cfinput type="text" name="MI" size=1 maxlength="2" 
                                                        tabindex="7" value="#QUERIES.GetEmpInfo.Middle#">                        	
                                                    <cfinput type="text" name="Last" 
                                                        error_message="Please provide a last name for the employee you'd like to hire." 
                                                        tabindex="10" value="#QUERIES.GetEmpInfo.Last#">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td>
                                                    Preferred Name:
                                                </td>
                                                <td>
                                                    <cfinput type="text" name="Preferred" tabindex="20" 
                                                        tooltip="Would appear in the Address Book and be used to create their network account." 
                                                        value="#QUERIES.GetEmpInfo.PreferredName#">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td>
                                                    Cost Code:
                                                </td>
                                                <td>
                                                    <cfinput type="text" name="CostCode" tabindex="20"  
                                                        value="#QUERIES.GetEmpInfo.CostCode#" style="width:70%">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td valign="top">
                                                    Eligibility:
                                                </td>
                                                <td>                                      	
                                                    <input type="checkbox" name="Benefits" Checked="<cfif QUERIES.GetEmpInfo.Benifits EQ 1>yes<cfelse>no</cfif>"
                                                        tabindex="50"> Benefits
                                                    <BR />
                                                    <input type="checkbox" name="Leave" Checked="<cfif QUERIES.GetEmpInfo.Leave EQ 1>yes<cfelse>no</cfif>"
                                                        tabindex="60"> Leave
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <TD nowrap=nowrap valign='top'>
                                                    Phones:
                                                </TD>
                                                <TD colspan=3>
                                                    <fieldset style='border:inset'>
                                                        <table>
                                                            <tr>
                                                                <td width =10>&nbsp;
                                                                    
                                                                </td>
                                                                <td nowrap=nowrap>
                                                                    Home Phone:
                                                                </td>
                                                                <td>
                                                                    <cfinput type='text' name='HomePhone' maxlength='14' 
                                                                        error_message='If provided, please confirm the home phone number with the employee.  The valid format is xxx-xxx-xxxx.' 
                                                                        value="#BASE.DisplayPhone(QUERIES.GetEmpInfo.HomePhone)#" tabindex="22" >
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td width =10>&nbsp;
                                                                    
                                                                </td>
                                                                <td nowrap=nowrap>
                                                                    Cell Phone:
                                                                </td>
                                                                <td>
                                                                    <cfinput type='text' name='CellPhone' maxlength='14' 
                                                                        error_message='If provided, please confirm the cell phone number with the employee.  The valid format is xxx-xxx-xxxx.' 
                                                                        value="#BASE.DisplayPhone(QUERIES.GetEmpInfo.CellPhone)#" tabindex="23" >
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td width =10>&nbsp;
                                                                    
                                                                </td>
                                                                <td nowrap=nowrap>
                                                                    Work Phone:
                                                                </td>
                                                                <td>
                                                                    <cfinput type='text' name='WorkPhone' maxlength='14' 
                                                                        error_message='If provided, please confirm the work phone number with the employee.  The valid format is xxx-xxx-xxxx.' 
                                                                        value="#BASE.DisplayPhone(QUERIES.GetEmpInfo.WorkPhone)#" tabindex="24" >
                                                                     x
                                                                     <cfinput type='text' name='WorkPhoneExt' maxlength=6
                                                                        error_message='Work Phone Extension (if provided) must be numeric.' 
                                                                        size=7 value="#QUERIES.GetEmpInfo.WorkPhoneExt#" tabindex="25" >
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </TD>
                                            </TR>
                                            <tr> 
                                                <td>&nbsp;</td>                   
                                                <td>
                                                    Contact Email:
                                                </td>
                                                <td>
                                                    <cfinput type="text" name="Email" maxlength="50" tabindex="28" 
                                                    tooltip="Confirm this email with the employee" 
                                                    message="Please provide the contact Email that appears on the employees application." 
                                                    style="width:98%" value="#QUERIES.GetEmpInfo.Email#" >
                                                </td>
                                            </tr>
                                            <tr> 
                                                <td>&nbsp;</td>       
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td>
                                                    Manager Comments:
                                                </td>
                                                <td>
                                                    #QUERIES.GetNotes.Notes#
                                                </td>
                                                
                                            </tr>
                                            <tr>
                                                <td>&nbsp;</td>
                                                <td>
                                                    Position to Hire:
                                                </td>
                                                <td>
                                                    #JobToHire#
                                                </td>
                                                
                                            </tr>
                                            <tr>
                                                <td width = "10">&nbsp;</td>
                                                <td>
                                                    Kronos HR Position:
                                                </td>
                                                <td colspan=3>
                                                    <cfselect name="PositionID" tabindex="10" >
                                                        <cfloop query="QUERIES.GetPositions">
                                                            <option value="#PositionIDNo#" <cfif PositionIDNo EQ QUERIES.GetEmpInfo.PositionID>Selected = selected</cfif>>
                                                                #PositionCode# - #PositionCodeDescription#
                                                            </option>
                                                        </cfloop>
                                                    </cfselect>                           
                                                </td>
                                            </tr>
                                            <TR>
                                                <td width = "10">&nbsp;</td>
                                                <TD>
                                                    Department:
                                                </TD>
                                                <TD colspan=3>
                                                    <cfif QUERIES.GetEmpInfo.DeptID EQ 0>
                                                        <cfset Selected = QUERIES.GetSupDept.OrgCodeIDNo>
                                                    <cfelse>
                                                        <cfset Selected = QUERIES.GetEmpInfo.DeptID>
                                                    </cfif>
                                                    <cfselect name="DeptID" query="QUERIES.GetDepts" tabindex="20" value="OrgCodeIDNo" 
                                                    display="Org" Selected ="#Selected#"/>
                                                </TD>
                                            </TR>
                                            <tr>
                                                <td width = "10">&nbsp;</td>
                                                <td>
                                                    Supervisor:
                                                </td>
                                                <td>
                                                    #SCF_Employee_ShowDropdown_AllEmployees('SupervisorID', QUERIES.GetEmpInfo.SupervisorID, 1, False, True, True)#
                                                </td>
                                            </TR>                                    
                                        </table>     
                                    </fieldset>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;
                                    
                                </td>
                           </tr>
                            <tr> 
                                <td>
                                    <fieldset>
                                        <legend>2) Information obtained negotiating the position:</legend>
                                        <table>
                                            <tr>
                                                <td width = "10">&nbsp;
                                                    
                                                </td>
                                                <td colspan="4">
                                                   <strong>Employee Position</strong>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>       
                                                <td nowrap="nowrap">
                                                    Employment Status:
                                                </td>
                                                <td>
                                                    <cfselect name="EmpCodeID" query="QUERIES.GetEmpCodes" value="EmploymentCodeIDNo" 
                                                    display="EmploymentCode" tabindex="75"/> 
                                                </td>
                                                <td width = 20>&nbsp;
                                                    
                                                </td> 
                                                <td valign="top" rowspan="5" nowrap="nowrap">
                                                    Estimated Start Date: <BR />
                                                    <cfinput type="hidden" name="EstStartDate" value="#DateFormat(now(), 'mm/dd/yyyy')#"/>
                                                    <div id="EstStart_datepicker"></div>
                                                </td>
                                            </tr>
                                            <tr>  
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>             
                                                <td>
                                                    Salary/Hourly:
                                                </td>
                                                <td>
                                                    <cfselect name="SalaryHourlyID" query ="QUERIES.GetSalaryHourly" value="ID" display="PersonCode" 
                                                    tabindex="30" selected="-10191"/>
                                                </td>
                                                <td width = 20>&nbsp;
                                                    
                                                </td>     
                                            </tr>
                                            <tr>  
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>             
                                                <td>
                                                    Shift:
                                                </td>
                                                <td>
                                                    <cfselect name="ShiftID" query ="QUERIES.GetShifts" value="ID" display="ShiftType" 
                                                    tabindex="35" selected="1"/>
                                                </td>
                                                <td width = 20>&nbsp;
                                                    
                                                </td>     
                                            </tr>
                                            <tr>  
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>            
                                                <td nowrap="nowrap">
                                                    FTE Hours/Week:
                                                </td>
                                                <td>
                                                    <cfinput name="HoursPerWeek"  maxlength="2" size ="1" 
                                                    value="40" tabindex="40" error_message='Must be an valid number.' />
                                                </td>
                                                <td width =20>&nbsp;
                                                    
                                                </td>       
                                            </tr>
                                            <tr>
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td valign="top">
                                                    Position Attributes:                                        
                                                </td>
                                                <td valign="top" nowrap="nowrap">   
                                                    <cfinput type="checkbox" name="Primary" checked="yes" tabindex="50"> Primary Position<BR />
                                                    <cfinput type="checkbox" name="Exempt" tabindex="60"> Exempt<BR />
                                                    <cfinput type="checkbox" name="FullTime" tabindex="65"> Full Time<BR />
                                                    <cfinput type="checkbox" name="Seasonal" tabindex="70"> Seasonal    <BR />
                                                    <cfinput type="radio" name="Daily" ID="Daily" value="1" checked="yes">Daily<BR />
                                                    <cfinput type="radio" name="Daily" ID="Daily" value="0">Half Daily
                                                </td>
                                                <td width = 20>&nbsp;
                                                    
                                                </td> 
                                            </tr>
                                            <tr>
                                                <td>&nbsp;
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "10">&nbsp;
                                                    
                                                </td>
                                                <td colspan="5">
                                                   <strong>Additional Job Info</strong>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td colspan="4">
                                                    Job Title:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <!---TODO: CHANGE THIS!!!!--->
                                                    <cfinput type="text" name="JobTitle" id="JobTitle" readonly="yes" 
                                                    value="" class="readonly" style="width:65%"/>      
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td colspan="2">
                                                    <table cellpadding="0" cellspacing="0" width="100%">
                                                        <tr>
                                                            <td>
                                                                Job Code:
                                                            </td>
                                                            <td width=95%>
                                                                <cfinput type="text" name="JobCode" id="JobCode" readonly="yes" 
                                                                value="" class="readonly"  />                                                           
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Hours/Year:
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="HoursPerYear" id="HoursPerYear" readonly="yes"   
                                                                value="0" class="readonly"/>              
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                Pay Grade:
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="PayGradeCode" id="PayGradeCode" readonly="yes"  
                                                                value="" class="readonly"/>         
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td nowrap="nowrap">
                                                                Pay Grade Desc:&nbsp;&nbsp;
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="PayGradeCodeDescription" id="PayGradeCodeDescription" 
                                                                readonly="yes" 
                                                                value="" class="readonly"  style="width:99%"/>             
                                                            </td>
                                                        </tr>                                                
                                                    </table>                                            
                                                </td> 
                                                <td>&nbsp;
                                                    
                                                </td> 
                                                <td> 
                                                    <table cellpadding="0" cellspacing="0" width="100%">
                                                        <tr>
                                                            <td nowrap="nowrap">
                                                                SCF UDF 1:
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="SCF_UDF1" id="SCF_UDF1" readonly="yes"  
                                                                value="" class="readonly"/>       
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td nowrap="nowrap">
                                                                SCF UDF 2:
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="SCF_UDF2" id="SCF_UDF2" readonly="yes"  
                                                                value="" class="readonly"/>             
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td nowrap="nowrap">
                                                                SCF UDF 3:
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="SCF_UDF3" id="SCF_UDF3" readonly="yes" 
                                                                value="" class="readonly"/>      
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td nowrap="nowrap">
                                                                Worker's Comp Code:
                                                            </td>
                                                            <td>
                                                                <cfinput type="text" name="WorkersCompCode" readonly="yes" value="0" class="readonly"/>    
                                                                <cfinput type="hidden" name="WorkersCompCodeID" />            
                                                            </td>
                                                        </tr>                                          
                                                    </table>                                        	
                                                </td>
                                            </tr>
                                            
                                            <tr>
                                                <td>&nbsp;
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "10">&nbsp;
                                                    
                                                </td>
                                                <td colspan="5">
                                                   <strong>Worker's Compensation</strong>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td>
                                                    State:&nbsp;&nbsp;Alaska 
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td colspan="4">
                                                    <cfselect name="WorkersCompID" tabindex="80">
                                                        <option value="-10001">None</option>
                                                        <cfloop query="QUERIES.GetWorkersCompInfo">
                                                            <option value="#WorkersCompensationIDNo#" <cfif WorkersCompensationIDNo EQ 0> selected=selected</cfif>>
                                                                #WorkersCompensationCode# #WorkersCompensationCodeDescription# (Rate=#WorkerCompRate#)
                                                            </option>
                                                        </cfloop>
                                                    </cfselect>
                                                                        
                                            </tr>
                                            <tr>
                                                <td>&nbsp;
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "10">&nbsp;
                                                    
                                                </td>
                                                <td colspan="5">
                                                   <strong>Pay Status</strong>
                                                </td>
                                            </tr>
                                              <tr>                                    	
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td>
                                                    Compensation Type:
                                                </td>
                                                <td colspan="4">
                                                    <cfselect name="CompTypeID" query="QUERIES.GetCompTypes" display="TypeCode" 
                                                    value="TypeCodeIDNo" tabindex="100" selected ="15"/>
                                                </td>
                                            </tr>
                                            <tr>                                    	
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td>
                                                    Frequency:
                                                </td>
                                                <td colspan="4">
                                                    <cfselect name="FrequencyID" tabindex="110">
                                                        <cfloop query="QUERIES.GetFrequency">
                                                           <option value="#ID#:#AnnualizingFactor#" <cfif ID EQ -10103>selected=selected</cfif>>
                                                                #PayRateFrequencyCode# (Annualizing Factor: #AnnualizingFactor#)
                                                            </option>
                                                        </cfloop>
                                                    </cfselect> 
                                                </td>
                                            </tr>
                                            <tr>                                    	
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td>
                                                    Pay Rate:
                                                </td>
                                                <td colspan="4">
                                                    <cfinput type="text" name="PayRate"
                                                        error_message="Please provide a numerical value for Pay Rate." 
                                                        tabindex="120">
                                                </td>
                                            </tr>
                                            <tr>                                    	
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td>
                                                    Annual Salary:
                                                </td>
                                                <td colspan="4">
                                                    <cfinput type="text" name="AnnaulSalary"
                                                        tabindex="130" error_message="An Annual Salary is required">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>&nbsp;
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width = "10">&nbsp;
                                                    
                                                </td>
                                                <td colspan="5">
                                                   <strong>Comments</strong>
                                                </td>
                                            </tr>
                                            <tr>                                    	
                                                <td width = "20" colspan="2">&nbsp;
                                                    
                                                </td>
                                                <td colspan="5">
                                                    <cftextarea name="Notes" rows="2" style="width:98%" tabindex="140" />
                                                </td>
                                            </tr>
                                        </table>     
                                    </fieldset>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="5" align="right" valign="middle" style="padding-top:5px;">
                                    <cfinput type="hidden" name="EmpID" value="#QUERIES.GetEmpInfo.ID#">
                                    <cfinput type="hidden" name="StepID" value="#URL.StepID#">
                                    <cfinput type="button" name="Submit" value="Next >>" tabindex="150" style="float:right">
                                    <cfinput type="button" name="DeclineOffer" value="Offer Declined" tabindex="149">
                                </td>
                            </tr>
                        </table>
            	</cfform>           
                
                
            <cfelse>
            
                This employee has already been processed.   To select another user, click <a href="Step2-PreOrientation1.cfm">Here</a>
                
            </cfif>        
        
        </div>
    
    <cfelse>
        <cfinclude template="denied.cfm">
    </cfif>
        

<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>